@layout("/common/_curd/_container.html"){

	<form data-url="${basePath}/${code}/save" method="post" class="form-horizontal" role="form">
		<!-- 表单 -->
		@ var _table="product";
		@ var _col=[
		@			  {name:"供应商*", index:"s_id", type:"hidden",newline:true,length:8,required:"required"},
		@			  {name:"供应商*", index:"sname", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"商品名*", index:"name", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"商品类型*", index:"type", type:"select_103",newline:true,length:8,required:"required"},
		@			  {name:"商品规格*", index:"unit", type:"text",newline:true,length:8,required:"required"},
		@			  {name:"生产厂家", index:"factory", type:"text",newline:true,length:8},
		@			  {name:"条码编号", index:"code", type:"text",newline:true,length:8},
		@			  {name:"产地", index:"address", type:"text",newline:true,length:8},
		@			  {name:"保质期(天)", index:"quality", type:"text",newline:true,length:8},
		@			  {name:"单价（元）", index:"money", type:"text",newline:true,length:8},
		@			  {name:"图片", index:"pic",  type:"imgupload",newline:true,length:8,returnType:"id"}
		@		   ];
		@ include("/common/_curd/_add.html", {"col":_col, "table":_table}){}
		
		<!-- 按钮 -->
		@ include("/common/_curd/_btn.html", {btn_save:"新增", btn_close:"关闭"}) {}
	</form>

<script>
	$(function () {
		var dept = '${dept!}';
		var deptname = '${deptname!}';
		if(dept !== 0){
			$("#_sname").val(deptname)
			$("#_sname").attr("disabled","disabled")
			$("#_s_id").val(dept)

		}
	})
</script>
<script>
	$('#_sname').on("click", function () {
		layer.open({
			type: 2,
			title: '选择供应商',
			shadeClose: true,
			area: ['100%', '100%'],
			content: '/suppliers/choose'//iframe的url

		})
	})
</script>

@}
